periodic function for trigonometric functions